import com.google.appengine.api.datastore.*
import static com.google.appengine.api.datastore.FetchOptions.Builder.*

def query = new Query("CheckRecord")
query.addSort("check_time", Query.SortDirection.DESCENDING)
PreparedQuery pq = datastore.prepare(query)
def ql = pq.asList(withLimit(100))

html.html {
	head {
		title "Show Check Records"
	}
	body {
		h1 "Show Check Records"
		table {
			tr{
				th align:"right", "Date"
				th align:"right", "Content"
				th align:"right", "Age"
			}
			ql.each {cr ->
				tr {
					td cr.check_time.format("yyyy-MM-dd HH:mm:ss")
					td cr.content
					td cr.age
				}
			}
		}

	}
}